#include "mainwindow.h"

#include <QApplication>
#include "test_sql.h"

void test1() {
    test_sql::testInsertAndQueryTeacher();
    test_sql::testInsertAndQueryCourse();
    test_sql::testInsertAndQueryEvaluation();
    test_sql::testInsertAndQueryStudent();
    test_sql::testInsertAndQueryUser();
    test_sql::test_query_teacher_by_name();
    test_sql::test_query_course_by_course_code();
}

MainWindow* MainWindow::ts;

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    if (AuthDialog().exec() == QDialog::Accepted)
    {
        MainWindow* mainWindow = new MainWindow;
        MainWindow::ts = mainWindow;
        mainWindow->setCurrentContent();
        mainWindow->show();
    }
    else
    {
        qDebug() << "Login dialog was not accepted.";
        //SqlHelper::getInstance().createConnection();
        //SqlHelper::getInstance().deleteDataBase();
        //SqlHelper::getInstance().createTables();
    }

    return a.exec();
}
